<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var num1 = prompt('请输入值')
        var num2 = num1 - 0

        switch(num2){
            case 1:
            case 3:
            case 5:
            case 7:
            case 9:
            case 11:
            alert('这个月有'+ '31天')

            case 4:
            case 6:
            case 8:
            case 10:
            case 12:
            alert('这个月有'+ '30天')
            case 2:alert('闰年这个月有'+'29平年这个月有28天')
        }
    </script>
</body>
</html>